package com.struc.td;
/*
 * Our level class creates our enemys for the given level and add waypoints to them
 * Also checks what type of enemy is to be created for the level
 */

import com.badlogic.gdx.utils.Array;

public class Level {
	private Array<Enemy> enemies;
	private int unittype;
	public static Array<Waypoint> waypoints;
	public Level(int level) {
		if (waypoints == null) {
			waypoints = new Array<Waypoint>();
			//1
			waypoints.add(new Waypoint(278,34));
			//2
			waypoints.add(new Waypoint(520,170));
			//3
			waypoints.add(new Waypoint(580,270));
			//4
			waypoints.add(new Waypoint(780,320));
			//5
			waypoints.add(new Waypoint(715,550));
			//6
			waypoints.add(new Waypoint(405,500));
			//7
			waypoints.add(new Waypoint(245,280));
			//8
			waypoints.add(new Waypoint(125,380));
			//9
			waypoints.add(new Waypoint(180,570));
			//10
			waypoints.add(new Waypoint(269,635));
			//11
			waypoints.add(new Waypoint(749,723));
			//12
			waypoints.add(new Waypoint(757,790));
			//13
			waypoints.add(new Waypoint(389,761));
			//14
			waypoints.add(new Waypoint(389,800));
		}
		enemies = new Array<Enemy>();
		unittype = level%3;
		for (int i = 0; i < 5; i++) {
			if(unittype == 1){
				enemies.add(new EnemyNormal(level,i,waypoints));
			}
			if(unittype ==2){
				enemies.add(new EnemyArmored(level,i,waypoints));
			}
			if(unittype ==0){
				enemies.add(new EnemySpeed(level,i,waypoints));
			}
		}
	}
	public Array<Enemy> getLevel() {
		return enemies;
	}
}